if dir = 1 then s := systemlimit(f, x = x0, right)
elif dir = -1 then s := systemlimit(f, x = x0, left)
else s := systemlimit(f, x = x0)
fi;
if type(s, 'range') then 'procname(args)' else s fi
protect(limit):
`print/limit` := proc(f, eq, dir)
local d;
if nargs = 4 then 'limit(args)'
else
if nargs = 3 then
if dir = 'left' then d := -1 else d := 1 fi
else d := 0
fi;
'limit'(f, lhs(eq), rhs(eq), d)
systemint := eval(int):
protect(systemint):
unprotect(int):
int := proc(f, x, a, b)
if nargs = 2 then systemint(args)
else systemint(f, x = a .. b)
protect(int):
`print/int` := proc(f, eq)
if type(eq, 'equation') then
'int'(f, lhs(eq), op(rhs(eq)))
else 'int(args)'
`print/exp` := x -> exp(1)^(x):
read `/dev/tty`:
Syntax12.Scn.Fnt
StyleElems
Alloc
Syntax10.Scn.Fnt
Example
# csh
stty -echo -ocrnl -imaxbel -icanon min 1 time 0
maple -q < .qmapleinit
stty sane
Title
ExprIcons
Alloc
ExprViews
AllocPlaceholder
ExprStd
AllocInteger
ExprStd
AllocSymbol
ExprStd
AllocBinaryOp
ExprStd
AllocPower
ExprIcons
AllocGraph
Example
ExprSlang
Alloc
ExprSlang
Alloc
Example
ExprMaple
AllocScript
Factor
Syntax10.Scn.Fnt
ExprIcons
Alloc
ExprViews
AllocPlaceholder
ExprIcons
AllocGraph
factor(
Example
ExprSlang
Alloc
Factor
Syntax10.Scn.Fnt
ExprIcons
Alloc
ExprViews
AllocPlaceholder
ExprIcons
AllocGraph
factor(
Example
ExprSlang
Alloc
Example
Anihilate
Syntax12i.Scn.Fnt
ExprIcons
Alloc
ExprViews
AllocPlaceholder
ExprIcons
AllocGraph
Example
ExprSlang
Alloc
Example
Anihilate
Syntax12i.Scn.Fnt
ExprIcons
Alloc
ExprViews
AllocPlaceholder
ExprIcons
AllocGraph
Example
ExprSlang
Alloc
Title
Syntax14b.Scn.Fnt
ExprMaple - User's Guide
Wolfgang Weck
Institute for Scientific Computing
ETH Z
Weck@inf.ethz.ch
Introduction
The ExprMaple package allows the ExpressionIcon editing package to interact with the Maple system. This interaction is limited in several aspects: Only singular operations on expressions are supported - in contrast to programming and the like. The interface does neither prohibit nor support other uses of Maple and has to be considered experimental with respect to this. Further, there is extra preparation needed for Maple to understand new extensions of the core package. In this version the expressions from the core package including the Lib0 extensions - but not the matrix extension - are supported. To increase portability of the entire system it is assumed that the user connects the system to Maple manually. It is described bellow how to do that. However, the Maple interface offers a programming interface too, thus allowing for programming script like modules.
Setting up the Maple Interface
The interface interacts with Maple through a serial communication link as provided by module Sessions. To install the interface in a specific session, execute the command ExprMaple.Install after marking a viewer that holds a terminal to that session. Maple is assumed to be running already in that session. Further, the echo of tty is supposed to be turned of and a special initialization file is expected to be executed by Maple, which needs to run in quiet mode. The typical sequence of actions on a Sparc computer is the following:
Terminal.Open ~
given that .qmapleinit contains:
.qmapleinit
execute within that terminal the script qmaple:
qmaple script
mark the viewer containing the terminal
ExprMaple.Install
After this the terminal might be closed or as well kept open for a session protocol and to close the connection after the session. To remove the link from the interface to the current session execute ExprMaple.Remove .
Evaluating with Maple
Two possibilities exist to activate an evaluation by Maple: One can simply apply the command ExprMaple.Eval
to the least recent selected expression or activate a script. The former sends the selected expression to Maple and replaces it by the answer provided by Maple. This allows for simple simplifications of expressions:
ExprMaple.Eval
To execute more sophisticated transformations with Maple, scripts need to be employed. These are text elements. The command ExprMaple.InsertScript inserts a new and empty script at the current focus position (caret). To edit a script, it must be opened through a middle-left interclick on it. Opening will display a new text viewer allowing to edit the script's contents. Also, editing the viewers name will cause the script's name to change. To make changes permanent, execute Icons.Update in the menu area of the viewer.
A script can be activated simply by clicking the middle mouse button on it. Upon activation the contents of the script will be sent to Maple literally. The only change happening is that every occurrence of an Placeholder-expression is substituted by the least recent selected expression.
Assume a script
containing the text factor(
The script
holds the text
and should almost ever result in 0:
Whenever a Maple interface command is activated, the least recent selected expression is going to be replaced by the result of the Maple operation. If this selection is a text stretch it is immediately replaced by an icon. Thus, in any case, there exists a single icon in a document that is going to be changed through the Maple operation. This icon is being marked by horizontal lines as currently not valid. (If a subexpression within an icon has been selected, only this subexpression is going to be changed but the entire icon is marked.) However, this mark does not prevent the user from deleting or copying it. But note, that only the original instance of the icon is going to be affected by the Maple operation. If the user deletes that instance, the result will be lost.
In case that the Maple operation produced an undesired result, the command ExprMaple.Undo can be used to undo a single. Again, this operation works on the icon used for display of the result only.
Example: Interactive Paper on Formula Manipulation using Maple
For further examples of useful scripts see the text ExprMaple.Tool text.
As a more sophisticated example, MapleFormManip.Text containes a reformulated and slightly changed version of a paper entitled Formula Manipulation using Maple by Dominik Gruntz from The Maple Technical Newsletter, Issue 10. It has been compiled in a primitive example of an interactive paper - a small version of an interactive text book.